<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>编辑文章</title>
    <style type="text/css">
		.checkbox{
			 margin-left:5px;
			 width:90px;
			 margin-top: 10px;
		}
		textarea{
			width: 300px;
			height: 100px;
		}
    </style>
    <link rel="stylesheet" type="text/css" href="__STATIC__/hdjs/hdjs.css"/>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor1_4_3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor1_4_3/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor1_4_3/lang/zh-cn/zh-cn.js"></script>
    <script src="__STATIC__/Js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
    	$(function(){
    		$('.close-img').click(function(){
    			//清空图片和关闭按钮 显示input file表单
    			$('.thumb-td').html('<input type="file" name="thumb" id="" />');
    			
    		})
    	})
    </script>
</head>
<body>
<div class="wrap">
    <div class="hd-title-header">编辑文章</div>
    <form action="" method="post" class="form-inline hd-form" enctype="multipart/form-data">
        <table class="hd-table hd-table-list">
            <tr>
                <th class="w100">文章标题</th>
                <td class="w100">
                    <input type="text" name="title" class="w200" value="{$oldData.title}"/> 
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">作者</th>
                <td>
                    <input type="text" name="author" class="w200" value="{$oldData.author}"/>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">所属分类</th>
                <td>
                    <select name="category_cid" class="w200">
                    	<option value="0">请选择分类</option>
                    	<foreach from="$cateData" key="$k" value="$v">
                    		<option value="{$v.cid}" <if value="$oldData['category_cid']==$v['cid']">selected</if>>{$v._name}</option>
                    	</foreach>
                    </select>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">文章摘要</th>
                <td>
                	<textarea name="digest" rows="" cols="">{$oldData.digest}</textarea>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">缩略图</th>
                <td class="thumb-td">
                	<if value="$oldData['thumb']">
                		<img src="__ROOT__/{$oldData.thumb}" style="width: 150px;height: 150px;"/>
						<a href="javascript:;" style="color: red;" class="close-img">X</a>
                	<else/>
                		<input type="file" name="thumb" id="" /> 
                	</if>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">文章属性</th>
                <td>
                	<label class="checkbox-inline">
						热门
						<input type="checkbox" value="热门" name="attr[]" class="check_input"  <if value="in_array('热门',$oldAttr)">checked</if> >
					</label>
					<label class="checkbox-inline">
						置顶
						<input type="checkbox" value="置顶" name="attr[]" class="check_input" <if value="in_array('置顶',$oldAttr)">checked</if>>
					</label>
					<label class="checkbox-inline">
						推荐
						<input type="checkbox" value="推荐" name="attr[]" class="check_input"  <if value="in_array('推荐',$oldAttr)">checked</if> >
					</label>
					<label class="checkbox-inline">
						图文
						<input type="checkbox" value="图文" name="attr[]" class="check_input" <if value="in_array('图文',$oldAttr)">checked</if>>
					</label>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">文章标签</th>
                <td>
                	<foreach from="$tagData" key="$k" value="$v">
                		{$v.tagname} <input type="checkbox" name="tagname[]" id="" value="{$v.tid}" <if value="in_array($v['tid'],$tagId)">checked</if> />
                	</foreach>
                </td>
                <td></td>
            </tr>
             <tr>
                <th class="w100">文章关键字</th>
                <td>
                    <textarea name="keywords" id="" rows="10">{$oldData.keywords}</textarea>
                </td>
                <td></td>
            </tr>
             <tr>
                <th class="w100">文章描述</th>
                <td>
                    <textarea name="description" id="" cols="30" rows="10">{$oldData.description}</textarea>
                </td>
                <td></td>
            </tr>
             <tr>
                <th class="w100">文章正文</th>
                <td>
                    <script id="ed" type="text/plain" style="width:600px;height:300px;" name="content">{$oldData.content}</script>
                    <script>
						var ue = UE.getEditor('ed');
					</script>
                </td>
                <td></td>
            </tr>
        
        </table>
        <div class="position-bottom">
        	<input type="hidden" name="aid" value="{$hd.get.aid}"/>
            <input type="submit" class="hd-btn hd-btn-success" value="修改"/>
        </div>
    </form>
</div>
</body>
</html>